(0) Obligation:

Clauses:

preorder(T, Xs) :- preorder_dl(T, -(Xs, [])).
preorder_dl(nil, -(X, X)).
preorder_dl(tree(L, X, R), -(.(X, Xs), Zs)) :- ','(preorder_dl(L, -(Xs, Ys)), preorder_dl(R, -(Ys, Zs))).

Query: preorder(g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

preorder_dlA(tree(X1, X2, X3), .(X2, X4)) :- preorder_dlB(X1, X4, X5).
preorder_dlA(tree(X1, X2, X3), .(X2, X4)) :- ','(preorder_dlcB(X1, X4, X5), preorder_dlA(X3, X5)).
preorder_dlB(tree(X1, X2, X3), .(X2, X4), X5) :- preorder_dlB(X1, X4, X6).
preorder_dlB(tree(X1, X2, X3), .(X2, X4), X5) :- ','(preorder_dlcB(X1, X4, X6), preorder_dlB(X3, X6, X5)).
preorderC(X1, X2) :- preorder_dlA(X1, X2).

Clauses:

preorder_dlcA(nil, []).
preorder_dlcA(tree(X1, X2, X3), .(X2, X4)) :- ','(preorder_dlcB(X1, X4, X5), preorder_dlcA(X3, X5)).
preorder_dlcB(nil, X1, X1).
preorder_dlcB(tree(X1, X2, X3), .(X2, X4), X5) :- ','(preorder_dlcB(X1, X4, X6), preorder_dlcB(X3, X6, X5)).

Afs:

preorderC(x1, x2)  =  preorderC(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
preorderC_in: (b,f)
preorder_dlA_in: (b,f)
preorder_dlB_in: (b,f,f)
preorder_dlcB_in: (b,f,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

PREORDERC_IN_GA(X1, X2) → U7_GA(X1, X2, preorder_dlA_in_ga(X1, X2))
PREORDERC_IN_GA(X1, X2) → PREORDER_DLA_IN_GA(X1, X2)
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → U1_GA(X1, X2, X3, X4, preorder_dlB_in_gaa(X1, X4, X5))
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → PREORDER_DLB_IN_GAA(X1, X4, X5)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → U4_GAA(X1, X2, X3, X4, X5, preorder_dlB_in_gaa(X1, X4, X6))
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → PREORDER_DLB_IN_GAA(X1, X4, X6)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U6_GAA(X1, X2, X3, X4, X5, preorder_dlB_in_gaa(X3, X6, X5))
U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → PREORDER_DLB_IN_GAA(X3, X6, X5)
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → U2_GA(X1, X2, X3, X4, preorder_dlcB_in_gaa(X1, X4, X5))
U2_GA(X1, X2, X3, X4, preorder_dlcB_out_gaa(X1, X4, X5)) → U3_GA(X1, X2, X3, X4, preorder_dlA_in_ga(X3, X5))
U2_GA(X1, X2, X3, X4, preorder_dlcB_out_gaa(X1, X4, X5)) → PREORDER_DLA_IN_GA(X3, X5)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil, X1, X1) → preorder_dlcB_out_gaa(nil, X1, X1)
preorder_dlcB_in_gaa(tree(X1, X2, X3), .(X2, X4), X5) → U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_in_gaa(X3, X6, X5))
U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_out_gaa(X3, X6, X5)) → preorder_dlcB_out_gaa(tree(X1, X2, X3), .(X2, X4), X5)

The argument filtering Pi contains the following mapping:
preorder_dlA_in_ga(x1, x2)  =  preorder_dlA_in_ga(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
preorder_dlB_in_gaa(x1, x2, x3)  =  preorder_dlB_in_gaa(x1)
preorder_dlcB_in_gaa(x1, x2, x3)  =  preorder_dlcB_in_gaa(x1)
nil  =  nil
preorder_dlcB_out_gaa(x1, x2, x3)  =  preorder_dlcB_out_gaa(x1)
U11_gaa(x1, x2, x3, x4, x5, x6)  =  U11_gaa(x1, x2, x3, x6)
U12_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U12_gaa(x1, x2, x3, x7)
PREORDERC_IN_GA(x1, x2)  =  PREORDERC_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
PREORDER_DLA_IN_GA(x1, x2)  =  PREORDER_DLA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
PREORDER_DLB_IN_GAA(x1, x2, x3)  =  PREORDER_DLB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4, x5, x6)  =  U4_GAA(x1, x2, x3, x6)
U5_GAA(x1, x2, x3, x4, x5, x6)  =  U5_GAA(x1, x2, x3, x6)
U6_GAA(x1, x2, x3, x4, x5, x6)  =  U6_GAA(x1, x2, x3, x6)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

PREORDERC_IN_GA(X1, X2) → U7_GA(X1, X2, preorder_dlA_in_ga(X1, X2))
PREORDERC_IN_GA(X1, X2) → PREORDER_DLA_IN_GA(X1, X2)
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → U1_GA(X1, X2, X3, X4, preorder_dlB_in_gaa(X1, X4, X5))
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → PREORDER_DLB_IN_GAA(X1, X4, X5)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → U4_GAA(X1, X2, X3, X4, X5, preorder_dlB_in_gaa(X1, X4, X6))
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → PREORDER_DLB_IN_GAA(X1, X4, X6)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U6_GAA(X1, X2, X3, X4, X5, preorder_dlB_in_gaa(X3, X6, X5))
U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → PREORDER_DLB_IN_GAA(X3, X6, X5)
PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → U2_GA(X1, X2, X3, X4, preorder_dlcB_in_gaa(X1, X4, X5))
U2_GA(X1, X2, X3, X4, preorder_dlcB_out_gaa(X1, X4, X5)) → U3_GA(X1, X2, X3, X4, preorder_dlA_in_ga(X3, X5))
U2_GA(X1, X2, X3, X4, preorder_dlcB_out_gaa(X1, X4, X5)) → PREORDER_DLA_IN_GA(X3, X5)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil, X1, X1) → preorder_dlcB_out_gaa(nil, X1, X1)
preorder_dlcB_in_gaa(tree(X1, X2, X3), .(X2, X4), X5) → U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_in_gaa(X3, X6, X5))
U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_out_gaa(X3, X6, X5)) → preorder_dlcB_out_gaa(tree(X1, X2, X3), .(X2, X4), X5)

The argument filtering Pi contains the following mapping:
preorder_dlA_in_ga(x1, x2)  =  preorder_dlA_in_ga(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
preorder_dlB_in_gaa(x1, x2, x3)  =  preorder_dlB_in_gaa(x1)
preorder_dlcB_in_gaa(x1, x2, x3)  =  preorder_dlcB_in_gaa(x1)
nil  =  nil
preorder_dlcB_out_gaa(x1, x2, x3)  =  preorder_dlcB_out_gaa(x1)
U11_gaa(x1, x2, x3, x4, x5, x6)  =  U11_gaa(x1, x2, x3, x6)
U12_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U12_gaa(x1, x2, x3, x7)
PREORDERC_IN_GA(x1, x2)  =  PREORDERC_IN_GA(x1)
U7_GA(x1, x2, x3)  =  U7_GA(x1, x3)
PREORDER_DLA_IN_GA(x1, x2)  =  PREORDER_DLA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
PREORDER_DLB_IN_GAA(x1, x2, x3)  =  PREORDER_DLB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4, x5, x6)  =  U4_GAA(x1, x2, x3, x6)
U5_GAA(x1, x2, x3, x4, x5, x6)  =  U5_GAA(x1, x2, x3, x6)
U6_GAA(x1, x2, x3, x4, x5, x6)  =  U6_GAA(x1, x2, x3, x6)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U5_GAA(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → PREORDER_DLB_IN_GAA(X3, X6, X5)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3), .(X2, X4), X5) → PREORDER_DLB_IN_GAA(X1, X4, X6)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil, X1, X1) → preorder_dlcB_out_gaa(nil, X1, X1)
preorder_dlcB_in_gaa(tree(X1, X2, X3), .(X2, X4), X5) → U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_in_gaa(X3, X6, X5))
U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_out_gaa(X3, X6, X5)) → preorder_dlcB_out_gaa(tree(X1, X2, X3), .(X2, X4), X5)

The argument filtering Pi contains the following mapping:
tree(x1, x2, x3)  =  tree(x1, x2, x3)
preorder_dlcB_in_gaa(x1, x2, x3)  =  preorder_dlcB_in_gaa(x1)
nil  =  nil
preorder_dlcB_out_gaa(x1, x2, x3)  =  preorder_dlcB_out_gaa(x1)
U11_gaa(x1, x2, x3, x4, x5, x6)  =  U11_gaa(x1, x2, x3, x6)
U12_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U12_gaa(x1, x2, x3, x7)
PREORDER_DLB_IN_GAA(x1, x2, x3)  =  PREORDER_DLB_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4, x5, x6)  =  U5_GAA(x1, x2, x3, x6)

We have to consider all (P,R,Pi)-chains

(8) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PREORDER_DLB_IN_GAA(tree(X1, X2, X3)) → U5_GAA(X1, X2, X3, preorder_dlcB_in_gaa(X1))
U5_GAA(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → PREORDER_DLB_IN_GAA(X3)
PREORDER_DLB_IN_GAA(tree(X1, X2, X3)) → PREORDER_DLB_IN_GAA(X1)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil) → preorder_dlcB_out_gaa(nil)
preorder_dlcB_in_gaa(tree(X1, X2, X3)) → U11_gaa(X1, X2, X3, preorder_dlcB_in_gaa(X1))
U11_gaa(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → U12_gaa(X1, X2, X3, preorder_dlcB_in_gaa(X3))
U12_gaa(X1, X2, X3, preorder_dlcB_out_gaa(X3)) → preorder_dlcB_out_gaa(tree(X1, X2, X3))

The set Q consists of the following terms:

preorder_dlcB_in_gaa(x0)
U11_gaa(x0, x1, x2, x3)
U12_gaa(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(10) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U5_GAA(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → PREORDER_DLB_IN_GAA(X3)
    The graph contains the following edges 3 >= 1

  • PREORDER_DLB_IN_GAA(tree(X1, X2, X3)) → PREORDER_DLB_IN_GAA(X1)
    The graph contains the following edges 1 > 1

  • PREORDER_DLB_IN_GAA(tree(X1, X2, X3)) → U5_GAA(X1, X2, X3, preorder_dlcB_in_gaa(X1))
    The graph contains the following edges 1 > 1, 1 > 2, 1 > 3

(11) YES

(12) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

PREORDER_DLA_IN_GA(tree(X1, X2, X3), .(X2, X4)) → U2_GA(X1, X2, X3, X4, preorder_dlcB_in_gaa(X1, X4, X5))
U2_GA(X1, X2, X3, X4, preorder_dlcB_out_gaa(X1, X4, X5)) → PREORDER_DLA_IN_GA(X3, X5)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil, X1, X1) → preorder_dlcB_out_gaa(nil, X1, X1)
preorder_dlcB_in_gaa(tree(X1, X2, X3), .(X2, X4), X5) → U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_in_gaa(X1, X4, X6))
U11_gaa(X1, X2, X3, X4, X5, preorder_dlcB_out_gaa(X1, X4, X6)) → U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_in_gaa(X3, X6, X5))
U12_gaa(X1, X2, X3, X4, X5, X6, preorder_dlcB_out_gaa(X3, X6, X5)) → preorder_dlcB_out_gaa(tree(X1, X2, X3), .(X2, X4), X5)

The argument filtering Pi contains the following mapping:
tree(x1, x2, x3)  =  tree(x1, x2, x3)
preorder_dlcB_in_gaa(x1, x2, x3)  =  preorder_dlcB_in_gaa(x1)
nil  =  nil
preorder_dlcB_out_gaa(x1, x2, x3)  =  preorder_dlcB_out_gaa(x1)
U11_gaa(x1, x2, x3, x4, x5, x6)  =  U11_gaa(x1, x2, x3, x6)
U12_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U12_gaa(x1, x2, x3, x7)
PREORDER_DLA_IN_GA(x1, x2)  =  PREORDER_DLA_IN_GA(x1)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(13) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PREORDER_DLA_IN_GA(tree(X1, X2, X3)) → U2_GA(X1, X2, X3, preorder_dlcB_in_gaa(X1))
U2_GA(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → PREORDER_DLA_IN_GA(X3)

The TRS R consists of the following rules:

preorder_dlcB_in_gaa(nil) → preorder_dlcB_out_gaa(nil)
preorder_dlcB_in_gaa(tree(X1, X2, X3)) → U11_gaa(X1, X2, X3, preorder_dlcB_in_gaa(X1))
U11_gaa(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → U12_gaa(X1, X2, X3, preorder_dlcB_in_gaa(X3))
U12_gaa(X1, X2, X3, preorder_dlcB_out_gaa(X3)) → preorder_dlcB_out_gaa(tree(X1, X2, X3))

The set Q consists of the following terms:

preorder_dlcB_in_gaa(x0)
U11_gaa(x0, x1, x2, x3)
U12_gaa(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.

(15) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U2_GA(X1, X2, X3, preorder_dlcB_out_gaa(X1)) → PREORDER_DLA_IN_GA(X3)
    The graph contains the following edges 3 >= 1

  • PREORDER_DLA_IN_GA(tree(X1, X2, X3)) → U2_GA(X1, X2, X3, preorder_dlcB_in_gaa(X1))
    The graph contains the following edges 1 > 1, 1 > 2, 1 > 3

(16) YES